<%@ Register TagPrefix="uc1" TagName="DateTimePicker" Src="../UserControls/DateTimePicker.ascx" %>
<%@ Register TagPrefix="uc1" TagName="BODetailTab" Src="../UserControls/BODetailTab.ascx" %>
<%@ Register TagPrefix="uc1" TagName="RecordNavigator" Src="../UserControls/RecordNavigator.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="BODetail.aspx.vb" Inherits="MIMS_WRS.Web.BODetail"%>
<%@ Register TagPrefix="uc1" TagName="JSCalendarSetup" Src="../UserControls/JSCalendarSetup.ascx" %>
<%@ Import namespace="MIMS_WRS.Web" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>Bulk Order Detail</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link href="detail.css" type="text/css" rel="stylesheet" name="Default stylesheet">
		<link href="common.css" type="text/css" rel="stylesheet" name="Default stylesheet">
		<script language="javascript" src="../js/common.js"></script>
		<script language="javascript">
	<!--
	var isOnSubmit = false;
	var isAlreadyRefresh = false;
	var initVarArray;	
	var isNoConfirm = false;
	
	function NoneSubmit(){
		 isOnSubmit = true;
		 isNoConfirm = true;
	}
	
	function checkEnterKey() {	
		if (event.keyCode == 13) {
			var btnSubmit = window.document.getElementById('<%= btnSubmit.ClientID %>');
			btnSubmit.click();
			event.returnValue = false;
		}
	}

	function getFormsElementValue() {
		
		var varArray = new Array();
		var inputCol = window.Form1.getElementsByTagName('input');	
		for (i=0; i<inputCol.length; i++) {
			var type = inputCol[i].type;
			if (type == "text") {
				varArray[varArray.length] = inputCol[i].value;
				inputCol[i].attachEvent("onkeydown", checkEnterKey);	
			}
			if (type == "radio" || type == "checkbox")
				varArray[varArray.length] = inputCol[i].checked;			
		}
		
		var areaCol = window.Form1.getElementsByTagName('area');	
		for (i=0; i<areaCol.length; i++) {
			varArray[varArray.length] = areaCol[i].outerText;		
		}
		
		var selectCol = window.Form1.getElementsByTagName('select');		
		for (i=0; i<selectCol.length; i++) {		
			varArray[varArray.length] = selectCol[i].selectedIndex;		
		}
		return varArray;
	}
	
	function typeOnChange() {		
		var ddlType = window.document.getElementById('<%= ddlType.ClientID %>');
		var spnQty = window.document.getElementById('spnQty');
		
		spnQty.innerHTML = "Total quantity ordered:";
		if (ddlType.options[ddlType.selectedIndex].value == '1') {
			for (i=1; i<4; i++) {
				var tr = window.document.getElementById('trQty' + i);
				tr.style.visibility = "visible";
				tr.style.display = "";
			}
		
		}
		else if (ddlType.options[ddlType.selectedIndex].value == '2' 
					|| ddlType.options[ddlType.selectedIndex].value == '3') {
			for (i=1; i<4; i++) {
				var tr = window.document.getElementById('trQty' + i);
				tr.style.visibility = "hidden";
				tr.style.display = "none";
			}
			spnQty.innerHTML = "Available quantity:";
		}
		//#43:Appear IF field TYPE = Stock Fact (SF) , if  TYPE = Ordered (OD) or Stock Clear (SC) then 4 fields(QtyUnitsPer40Cont,QtyUnitsPer20Cont,UnitWeight,HarmzedCode) should not be shown
		var spantyUnitsPerContType = window.document.getElementById('spantyUnitsPerContType');
		if (ddlType.options[ddlType.selectedIndex].value == '3') {
			spantyUnitsPerContType.style.visibility = "visible";	
			spantyUnitsPerContType.style.display = "";		
		}
		else if (ddlType.options[ddlType.selectedIndex].value == '1' || ddlType.options[ddlType.selectedIndex].value == '2') {
			spantyUnitsPerContType.style.visibility = "hidden";	
			spantyUnitsPerContType.style.display = "none";		
		}					
	}
	
	function window_onbeforeunload() {
		var isChanged = false;
		var newVarArray = getFormsElementValue();
		for (i=0; i<newVarArray.length; i++)
			if (newVarArray[i] != initVarArray[i]) {
				isChanged = true;
				break;
			}
			 	
		if (isChanged && isOnSubmit == false) {
			if(isNoConfirm==false){
				event.returnValue = "There are changes on your form.\nAre you sure you want to leave the page?";
			}
		}	
	}
	
	function refreshOpener() {
		if (window.opener.form1.btnRefresh)
			window.opener.form1.btnRefresh.click();
	}
	function window_onunload() {
		//click "X"?
		if (event.clientY < 0) {
			if (isOnSubmit == false && isAlreadyRefresh == false) {
			<% If RequestContext.Changed = True Then %>
				refreshOpener();
			<% End If %>
			}
		}
	}
	
	function windowCloseAndRefresh() {
		isAlreadyRefresh = true;
		<% If RequestContext.Changed = True Then %>
			refreshOpener();
		<% End If %>
		window.close();
	}
	
	function checkLogic() {
		
		var notStarted = calculateQtyNotStarted();		
		if (isNaN(notStarted) || notStarted < 0) {
			alert('quantity not started must be large or equal zero');
			return false;
		}		
		return true;
		
	}
	
	function form_onsubmit() {		
		checkLogic();	
		ValidatorOnSubmit();		
		isOnSubmit = true;
	}
	
	function calculateQtyNotStarted() {
	
		var ordered = parseInt(window.document.getElementById('<%= txtQtyOrdered.ClientID %>').value, 10);
		var completed = parseInt(window.document.getElementById('<%= txtQtyCompleted.ClientID %>').value, 10);
		var above50 = parseInt(window.document.getElementById('<%= txtQtyAbove50.ClientID %>').value, 10);
		var below50 = parseInt(window.document.getElementById('<%= txtQtyBelow50.ClientID %>').value, 10);
		if (isNaN(ordered)) completed = 0;
		if (isNaN(completed)) completed = 0;
		if (isNaN(above50)) above50 = 0;
		if (isNaN(below50)) below50 = 0;
		var notStarted = ordered - (completed + above50 + below50);
		var spnNotStarted = window.document.getElementById('spnQtyNotStarted');
		if (isNaN(notStarted))
			spnNotStarted.innerHTML = '[not available]';
		else  
		{
			if (notStarted < 0)
				spnNotStarted.className = "ErrorMessage";
		else
				spnNotStarted.className = "";
			spnNotStarted.innerHTML = notStarted;
		}
		return notStarted;
	}	
	
	function catalogOnChange() {
		var txtCatalogue = window.document.getElementById('<%= txtCatalogue.ClientID%>');
		var ddlCat = window.document.getElementById('<%= ddlCat.ClientID %>');
		if (ddlCat.selectedIndex > 0) {
			txtCatalogue.style.display = "none";
		}
		else
			txtCatalogue.style.display = "";
	}
	
	function window_onload() {				
		window.Form1.onsubmit = form_onsubmit;			
		calculateQtyNotStarted();	
		
		UnitMeasurementOnChange();
		CalculateUnitFOBPrice();
			
		initVarArray = getFormsElementValue();	
		<% if IsAddNew then %>
		window.document.getElementById('<%= txtCatalogue.ClientID %>').focus();
		<% else %>
		window.document.getElementById('<%= txtPage.ClientID %>').focus();
		<% end if%>
		typeOnChange();
		catalogOnChange();
		chkIsShownInLGDCatalog_Changed();
		
		//View/hide Product Dimensions(Diameter,Length, Width, Height)
		var chkPotRound = document.getElementById("chkProductRound");
		ReloadDimensions(chkPotRound);
	}
	
	function ddlOwnerChanged() {
		var txtCatalogue = window.document.getElementById('<%= txtCatalogue.ClientID%>');
		var ddlOwner = window.document.getElementById('<%=  ddlOwner.ClientID %>');
		var hidCurrentOwner = window.document.getElementById('<%=  hidCurrentOwner.ClientID %>');
		var oldValue = hidCurrentOwner.value;
		var newValue = ddlOwner.options[ddlOwner.selectedIndex].value;
		hidCurrentOwner.value = newValue;
		if (oldValue != newValue && (newValue == '9999' || oldValue == '9999')) {
			fakePostBack();			
		}		
	}
	
	function fakePostBack() {
		isOnSubmit = true;
		var btnFakeSubmit = window.document.getElementById('<%=  btnFakeSubmit.ClientID %>');
		btnFakeSubmit.click();
	}
	
	function chkIsShownInLGDCatalog_Changed() {
		var rdbIsShownNo = window.document.getElementById('<%=  rdbIsShownNo.ClientID %>');
		
		var txtLGDQty = window.document.getElementById('<%=  txtPackQty.ClientID %>');
		var ddlLGDDesc = window.document.getElementById('<%=  ddlCatPackDesc.ClientID %>');
						
		txtLGDQty.disabled = rdbIsShownNo.checked;
		ddlLGDDesc.disabled = rdbIsShownNo.checked;		
		
		
		if (rdbIsShownNo.checked) {			
			if (txtLGDQty.value != '1') txtLGDQty.value = '1';
		}
		
	}	
		
	function openTerritoryDialog() {
		var url = '../Offices/BOTerritoryEdit.aspx?id=' + document.getElementById("hidTerritoryID").value + '&secondValue=' + document.getElementById("hidProductCode").value;
		var title = escape('HD - Territories Prices 1.5');
		var height = 200;
		var width = 550;
		var iTop = (screen.height-height-30)/2;
		var iLeft = (screen.width-width)- 30;			
		return window.showModalDialog('../Dialogs/ShowDialog.aspx?title=' + title + '&src=' + url, '', 'dialogLeft: ' +iLeft+ 'px; dialogTop:' + iTop+ 'px; dialogHeight: ' + height + 'px; dialogWidth: ' + width + 'px; center: no; resizable: no; scroll: no; status: no;');
	}
	
	function ReloadDimensions(chkProductRound){
		if(chkProductRound.checked == true){
			document.getElementById("lblDimension").innerHTML = "Diameter (cm):";
					
			//Invisible Witdth
			document.getElementById("trWidth").style.visibility = "hidden";
			document.getElementById("trWidth").style.display = "none";
			document.getElementById("trWidth").style.visibility = "hidden";
					}
		else{
		
			document.getElementById("lblDimension").innerHTML = "Length (cm):";
			
			document.getElementById("trWidth").style.visibility = "visible";	
			document.getElementById("trWidth").style.display = "";
			
		}
			
	}
	//Handle onchange event of ddlUnits
	function UnitMeasurementOnChange()
	{
		var hidUnitValueArray = window.document.getElementById('<%=  hidUnitValueArray.ClientID %>');
		var ddlUnits = window.document.getElementById('<%=  ddlUnits.ClientID %>');
		var txtMinQtyVolume = window.document.getElementById('<%=  txtMinQtyVolume.ClientID %>');
		var valueArr = hidUnitValueArray.value.split(";");
		
		txtMinQtyVolume.value = "";
		for (var i = 0; i < valueArr.length; i++) {
			if(i  == ddlUnits.selectedIndex -1 )
			{
				txtMinQtyVolume.value = valueArr[i];
				break;
			}
		}
	}
		
function roundNumber(num, dec) {
  var result = String(Math.round(num*Math.pow(10,dec))/Math.pow(10,dec));
  if(result.indexOf('.')<0) {result+= '.';}
  while(result.length- result.indexOf('.')<=dec) {result+= '0';}
  return result;
}

	function CalculateUnitFOBPrice()
	{
		var txtFOB = window.document.getElementById('<%=  txtFOB.ClientID %>');
		var txtUnitsPerOuter = window.document.getElementById('<%=  txtUnitsPerOuter.ClientID %>');
		var txtUnitFOBPrice = window.document.getElementById('<%=  txtUnitFOBPrice.ClientID %>');
		var valueOfFOB = txtFOB.value;
		var valueOfUnitsPerOuter;
		var valueOfUnitFOBPrice;
		
		if(txtUnitsPerOuter.value == 0 || txtUnitsPerOuter.value == '0')
		{
			txtUnitsPerOuter.value = 1;
		}
		
		valueOfUnitsPerOuter = txtUnitsPerOuter.value;
		if(valueOfUnitsPerOuter > 0)
		{
			valueOfUnitFOBPrice = valueOfFOB/valueOfUnitsPerOuter;
			txtUnitFOBPrice.value =  roundNumber(valueOfUnitFOBPrice,2);
		}
	}
	
	//-->
		</script>
	</HEAD>
	<body bottommargin="0" onbeforeunload="window_onbeforeunload()" leftmargin="0" topmargin="0"
		scroll="yes" onload="return window_onload()" rightmargin="0" onunload="window_onunload()">
		<form id="Form1" method="post" runat="server">
			<uc1:recordnavigator id="RecordNavigator1" runat="server"></uc1:recordnavigator><uc1:bodetailtab id="BODetailTab1" runat="server"></uc1:bodetailtab><uc1:jscalendarsetup id="JSCalendarSetup1" runat="server"></uc1:jscalendarsetup>
			<table class="FormTable" cellspacing="1" cellpadding="1" width="100%" border="0" bordercolor="#0000ff">
				<tr>
					<td align="center" colspan="2"><asp:label id="lblMessage" runat="server" cssclass="ErrorMessage">&nbsp;</asp:label></td>
				</tr>
				<tr>
					<td align="center" colspan="2">
						<table class="FormTable" cellspacing="1" cellpadding="2" width="100%" border="0" bordercolor="red">
							<tr>
								<!-- Data-->
								<td width="54%">
									<table class="FormTable" cellspacing="1" cellpadding="2" width="100%" border="0" bordercolor="green">
										<tr>
											<td class="Supplier Label">Owner:</td>
											<td><asp:dropdownlist id="ddlOwner" runat="server" onchange="ddlOwnerChanged()"></asp:dropdownlist>&nbsp;<span class="Supplier Label">BO 
													No</span><asp:textbox runat="server" id="txtBONo" maxlength="6" columns="8"></asp:textbox>
												<asp:regularexpressionvalidator controltovalidate="txtBONo" id="RegularExpressionValidator1" runat="server" errormessage="BO No must have xxx-yy format"
													display="Dynamic" validationexpression="(\d{3})-(\d{2})">!</asp:regularexpressionvalidator></td>
										</tr>
										<tr>
											<td class="Supplier Label" width="193">Catalogue:</td>
											<td><asp:dropdownlist id="ddlCat" runat="server" onchange="catalogOnChange()"></asp:dropdownlist><asp:textbox id="txtCatalogue" runat="server" maxlength="50" columns="15"></asp:textbox>&nbsp;<span class="Supplier Label">page:</span>
												<asp:textbox id="txtPage" runat="server" maxlength="3" columns="5"></asp:textbox></td>
										</tr>
										<tr>
											<td class="Supplier Label" width="193"><span class="Required">*</span> <span title="Date when the order was made by office.">
													Order date:</span>
											</td>
											<td>
												<table class="FormTable" cellspacing="0" cellpadding="0" border="0">
													<tr>
														<td><uc1:datetimepicker id="calOrderDate" runat="server" requiredtext="!" requirederrormessage="please input order date"
																enablerequiredvalidator="true"></uc1:datetimepicker></td>
														<td class="Supplier Label">&nbsp;&nbsp;<span class="Required">*</span> <span title="An order can be ordered by offices (Ordered) or can be created by manufacturer (Stock).">
																Type:</span></td>
														<td><asp:dropdownlist id="ddlType" runat="server" onchange="typeOnChange()">
																<asp:listitem value="-1">[--select--]</asp:listitem>
																<asp:listitem value="1">Ordered (OD)</asp:listitem>
																<asp:listitem value="2">Stock Clear (SC)</asp:listitem>
																<asp:listitem value="3">Stock Fact (SF)</asp:listitem>
															</asp:dropdownlist><asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" initialvalue="-1" display="Dynamic"
																errormessage="please select type" controltovalidate="ddlType">!</asp:requiredfieldvalidator></td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td class="Supplier Label"><span class="required">*</span> <span title="Product code of the order, 10 chars long">
													Product code:</span></td>
											<td><asp:textbox id="txtProductCode" runat="server" maxlength="10" columns="14"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" display="Dynamic" errormessage="please enter product code"
													controltovalidate="txtProductCode">!</asp:requiredfieldvalidator>&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="lnkViewProductPicture" Runat="server">View Picture</asp:LinkButton></td>
										<tr>
											<td class="Supplier Label"><span title="Description of the order">Descriptions:</span></td>
											<td><asp:textbox id="txtDescription" runat="server" columns="70"></asp:textbox></td>
										</tr>
										<tr>
											<td class="Supplier Label"><span title="Color of the product, max 10 characters">Color:</span></td>
											<td><asp:textbox id="txtColor" runat="server" maxlength="30" columns="30"></asp:textbox></td>
										</tr>
										<tr>
											<td class="Supplier Label"><span title="Date when the production started">Start date:</span></td>
											<td><uc1:datetimepicker id="calStartDate" runat="server"></uc1:datetimepicker></td>
										</tr>
										<tr>
											<td class="Supplier Label"><span class="Required">*</span>&nbsp; <span id="spnQty" title="Total quantity of the product that has been ordered">
													Initial quantity:</span></td>
											<td><asp:textbox onkeypress="NumberOnly(0)" id="txtQtyOrdered" runat="server" onchange="calculateQtyNotStarted()"
													maxlength="5" columns="8"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator3" runat="server" display="Dynamic" errormessage="please input total quantity ordered"
													controltovalidate="txtQtyOrdered">!</asp:requiredfieldvalidator><asp:rangevalidator id="RangeValidator1" runat="server" display="Dynamic" errormessage="total quantity ordered must > 0"
													controltovalidate="txtQtyOrdered" minimumvalue="1" maximumvalue="99999" type="Integer">!</asp:rangevalidator></td>
										</tr>
									</table>
								</td>
								<td width="46%" valign="top">
									<!-- Picture-->
									<span id="spanShowPicture" runat="server">
										<% =GetPictureHTML() %>
									</span>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="Supplier Label">Unit / Outer Description:</td>
					<td><asp:dropdownlist id="ddlPack" runat="server">
							<asp:listitem value=""></asp:listitem>
							<asp:listitem value="1PIE">Pieces</asp:listitem>
							<asp:listitem value="2SET">Sets</asp:listitem>
							<asp:listitem value="2UNT">Units</asp:listitem>
							<asp:listitem value="3OUT">Outers</asp:listitem>
							<asp:listitem value="4HDP">Half Pallet</asp:listitem>
							<asp:listitem value="5TSP">Tall Pallet</asp:listitem>
							<asp:listitem value="8HCC">Half Crate</asp:listitem>
							<asp:listitem value="4MHP">Mixed Half Pallet</asp:listitem>
							<asp:listitem value="4AMP">Mixed Tall Pallet</asp:listitem>
						</asp:dropdownlist>
					</td>
				</tr>
				<tr id="trQty1">
					<td class="Supplier Label"><span title="Total quantity of the product that has been completed">Total 
							quantity completed:</span></td>
					<td>
						<table class="FormTable" cellspacing="0" cellpadding="0" border="0" bordercolor="yellow">
							<tr>
								<td><asp:textbox onkeypress="NumberOnly(0)" id="txtQtyCompleted" runat="server" onchange="calculateQtyNotStarted()"
										maxlength="5" columns="8"></asp:textbox><asp:rangevalidator id="RangeValidator5" runat="server" display="Dynamic" errormessage="total quantity completed must >= 0"
										controltovalidate="txtQtyCompleted" minimumvalue="0" maximumvalue="99999" type="Integer">!</asp:rangevalidator></td>
								<td class="Supplier Label">&nbsp;&nbsp;&nbsp;above 50%:</td>
								<td class="Supplier Label"><asp:textbox onkeypress="NumberOnly(0)" id="txtQtyAbove50" runat="server" onchange="calculateQtyNotStarted()"
										maxlength="5" columns="8"></asp:textbox><asp:rangevalidator id="RangeValidator3" runat="server" display="Dynamic" errormessage="total quantity above 50% must >= 0"
										controltovalidate="txtQtyAbove50" minimumvalue="0" maximumvalue="99999" type="Integer">!</asp:rangevalidator></td>
								<td class="Supplier Label">&nbsp;&nbsp;&nbsp;below 50%:</td>
								<td class="Supplier Label"><asp:textbox onkeypress="NumberOnly(0)" id="txtQtyBelow50" runat="server" onchange="calculateQtyNotStarted()"
										maxlength="5" columns="8"></asp:textbox><asp:rangevalidator id="RangeValidator4" runat="server" display="Dynamic" errormessage="total quantity below 50% must >= 0"
										controltovalidate="txtQtyBelow50" minimumvalue="0" maximumvalue="99999" type="Integer">!</asp:rangevalidator></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr id="trQty2">
					<td class="Supplier Label">Quantity not started:</td>
					<td><span id="spnQtyNotStarted"></span></td>
				</tr>
				<tr id="trQty3">
					<td class="Supplier Label"><span title="Estimated date when 100% ordered quantity completed">Estimated 
							complete date:</span></td>
					<td><uc1:datetimepicker id="calEstimatedDate" runat="server"></uc1:datetimepicker></td>
				</tr>
				<tr>
					<td class="Supplier Label">Stock location:</td>
					<td>
						<table class="FormTable" cellspacing="0" cellpadding="0" border="0">
							<tr>
								<td><asp:dropdownlist id="ddlStockLocated" runat="server"></asp:dropdownlist></td>
								<td class="Supplier Label">&nbsp;&nbsp;<span title="Denote the last time when stock was checked">Stock 
										last check date:</span></td>
								<td><uc1:datetimepicker id="calStkLastCheckDate" runat="server"></uc1:datetimepicker></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="Supplier Label"><span title="Denote the quantity of the last checked time">Stock 
							qty inspected:</span></td>
					<td><asp:textbox onkeypress="NumberOnly(0)" id="txtStkLastCheck" runat="server" columns="8"></asp:textbox><asp:rangevalidator id="RangeValidator6" runat="server" display="Dynamic" errormessage="stock last check quantity must >= 0"
							controltovalidate="txtStkLastCheck" minimumvalue="0" maximumvalue="99999" type="Integer">!</asp:rangevalidator>
						&nbsp;&nbsp;<span class="Supplier Label">Is this Product shown in the LGD Catalog?</span><asp:RadioButton ID="rdbIsShownYes" Runat="server" Text="Yes" GroupName="LGDCatalog" onclick="chkIsShownInLGDCatalog_Changed()"></asp:RadioButton><asp:RadioButton onclick="chkIsShownInLGDCatalog_Changed()" ID="rdbIsShownNo" Runat="server" Text="No"
							GroupName="LGDCatalog" Checked="True"></asp:RadioButton></td>
				</tr>
				<tr>
					<td class="Supplier Label">LGD Cat. Pack Qty:</td>
					<td><asp:textbox onkeypress="NumberOnly(0)" id="txtPackQty" Text="1" runat="server" maxlength="3"
							columns="5"></asp:textbox>
						<asp:RangeValidator id="RangeValidator9" runat="server" ErrorMessage="LGD Catalog Pack Qty must large or equal to 1"
							Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="99999" ControlToValidate="txtPackQty">!</asp:RangeValidator>
						&nbsp;&nbsp;<span class="Supplier Label">LGD Cat. Pack Desc.</span><asp:dropdownlist id="ddlCatPackDesc" runat="server">
							<asp:listitem value=""></asp:listitem>
							<asp:listitem value="1PIE">Pieces</asp:listitem>
							<asp:listitem value="2SET">Sets</asp:listitem>
							<asp:listitem value="2UNT">Units</asp:listitem>
							<asp:listitem value="3OUT">Outers</asp:listitem>
							<asp:listitem value="4HDP">Half Pallet</asp:listitem>
							<asp:listitem value="5TSP">Tall Pallet</asp:listitem>
							<asp:listitem value="8HCC">Half Crate</asp:listitem>
							<asp:listitem value="4MHP">Mixed Half Pallet</asp:listitem>
							<asp:listitem value="4AMP">Mixed Tall Pallet</asp:listitem>
						</asp:dropdownlist></td>
				</tr>
				<tr>
					<td class="Supplier Label">MUK/THG Cat. Pack Qty:</td>
					<td><asp:textbox onkeypress="NumberOnly(0)" id="txtMUKTHGCatPackQty" runat="server" maxlength="3"
							columns="5">1</asp:textbox>
						<asp:RangeValidator id="Rangevalidator7" runat="server" ErrorMessage="MUK/THG Catalog Pack Qty must large or equal to 1"
							Display="Dynamic" Type="Integer" MinimumValue="1" MaximumValue="99999" ControlToValidate="txtMUKTHGCatPackQty">!</asp:RangeValidator>
						&nbsp;&nbsp;<span class="Supplier Label">MUK/THG Cat. Pack Desc.</span><asp:dropdownlist id="ddlMUKTHGCatPackDesc" runat="server">
							<asp:listitem value=""></asp:listitem>
							<asp:listitem value="1PIE">Pieces</asp:listitem>
							<asp:listitem value="2SET">Sets</asp:listitem>
							<asp:listitem value="2UNT">Units</asp:listitem>
							<asp:listitem value="3OUT">Outers</asp:listitem>
							<asp:listitem value="4HDP">Half Pallet</asp:listitem>
							<asp:listitem value="5TSP">Tall Pallet</asp:listitem>
							<asp:listitem value="8HCC">Half Crate</asp:listitem>
							<asp:listitem value="4MHP">Mixed Half Pallet</asp:listitem>
							<asp:listitem value="4AMP">Mixed Tall Pallet</asp:listitem>
						</asp:dropdownlist>
					</td>
				</tr>
				<tr>
					<td class="Supplier Label" title="Current FOB price of the product per unit">Outer 
						FOB 1.5 Price (USD):</td>
					<td>
						<table class="FormTable" cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td><asp:textbox onkeypress="NumberOnly(1)" id="txtFOB" runat="server" maxlength="8" columns="8"
										onchange="CalculateUnitFOBPrice();"></asp:textbox><asp:CompareValidator id="CompareFieldValidator1" runat="server" ForeColor="Red" ControlToValidate="txtFOB"
										ValueToCompare="0" Type="Double" Operator="GreaterThan" ErrorMessage="FOB must be greater than 0" display="Dynamic">!
								</asp:CompareValidator></td>
								<td class="Supplier Label">&nbsp;&nbsp;<span>Units per Outer:</span></td>
								<td><asp:textbox onkeypress="NumberOnly(0)" id="txtUnitsPerOuter" runat="server" maxlength="5" columns="5"
										Text="1" onchange="CalculateUnitFOBPrice();"></asp:textbox></td>
								<td class="Supplier Label">&nbsp;&nbsp;<span>Unit FOB 1.5 Price (USD):</span></td>
								<td><asp:textbox onkeypress="NumberOnly(1)" ReadOnly="True" id="txtUnitFOBPrice" runat="server" maxlength="8"
										columns="8"></asp:textbox></td>
								<td class="Supplier Label">&nbsp;&nbsp;<span title="Date when the bulk order was completed">Completed 
										date:</span></td>
								<td><uc1:datetimepicker id="calCompletedDate" runat="server"></uc1:datetimepicker></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="Officer Label">Sales description 1:</td>
					<td><asp:textbox id="txtSalesDescription1" runat="server" maxlength="40" columns="40"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Officer Label">Sales description 2:</td>
					<td><asp:textbox id="txtSalesDescription2" runat="server" maxlength="40" columns="40"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Officer Label"></td>
					<td><asp:checkbox id="chkProductRound" runat="server" text="Tick if this is a round product" onclick="ReloadDimensions(this)"></asp:checkbox>&nbsp;</td>
				</tr>
				<tr id="trDiaOrLen">
					<td class="Officer Label" align="right"><span id="lblDimension">Diameter (cm):</span></td>
					<td><span class="Officer Label">S1 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtDiaOrLenS1" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S2 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtDiaOrLenS2" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S3 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtDiaOrLenS3" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S4 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtDiaOrLenS4" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S5 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtDiaOrLenS5" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S6 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtDiaOrLenS6" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S7 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtDiaOrLenS7" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S8 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtDiaOrLenS8" runat="server" maxlength="5" columns="6"></asp:textbox></td>
				</tr>
				<tr id="trWidth">
					<td class="Officer Label">Width (cm):</td>
					<td><span class="Officer Label">S1 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtWidth1" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S2 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtWidth2" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S3 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtWidth3" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S4 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtWidth4" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S5 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtWidth5" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S6 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtWidth6" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S7 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtWidth7" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S8 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtWidth8" runat="server" maxlength="5" columns="6"></asp:textbox></td>
				</tr>
				<tr id="trHeight">
					<td class="Officer Label">Height (cm):</td>
					<td><span class="Officer Label">S1 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtheightS1" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S2 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtheightS2" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S3 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtheightS3" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S4 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtheightS4" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S5 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtheightS5" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S6 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtheightS6" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S7 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtheightS7" runat="server" maxlength="5" columns="6"></asp:textbox>
						<span class="Officer Label">S8 </span>
						<asp:textbox onkeypress="NumberOnly(1)" id="txtheightS8" runat="server" maxlength="5" columns="6"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Officer Label">Minimum Order Qty:</td>
					<td><asp:textbox id="txtMinOrderQty" onkeypress="NumberOnly(1)" runat="server" maxlength="4" columns="4"></asp:textbox>
						<span class="Officer Label">Desc:</span><asp:textbox id="txtMinOrderDesc" runat="server" maxlength="20" columns="20"></asp:textbox>
						<span class="Officer Label">Unit Vol:</span><asp:DropDownList ID="ddlUnits" Runat="server" onchange="UnitMeasurementOnChange()"></asp:DropDownList>
						<span class="Officer Label">Min Qty Volume</span><asp:textbox id="txtMinQtyVolume" ReadOnly="True" runat="server" maxlength="11" columns="11"></asp:textbox>(cbm)
						<span class="Officer Label">Tall Pallet Qty:</span><asp:textbox id="txtTallPalletQty" runat="server" maxlength="24" columns="24"></asp:textbox></td>
				</tr>
				<tr>
					<td class="Officer Label">HD - Territories Prices 1.5</td>
					<td><a href="javascript:;" onclick="openTerritoryDialog()">view...</a>&nbsp;<span id="spantyUnitsPerContType">
							<span class="Supplier Label">Qty Units per 40' </span>
							<asp:textbox onkeypress="NumberOnly(0)" id="txtQtyUnitsPer40Cont" runat="server" maxlength="5"
								columns="6"></asp:textbox>
							<span class="Supplier Label">and 20' </span>
							<asp:textbox onkeypress="NumberOnly(0)" id="txtQtyUnitsPer20Cont" runat="server" maxlength="5"
								columns="6"></asp:textbox><span class="Supplier Label"> containers. </span><span class="Supplier Label">
								Unit weight (kg) </span>
							<asp:textbox onkeypress="NumberOnly(1)" id="txtUnitWeight" runat="server" maxlength="7" columns="8"></asp:textbox>
							<span class="Supplier Label">Harm'zed Code </span>
							<asp:dropdownlist id="ddlHCCCode" runat="server" Width="170px"></asp:dropdownlist></span>
					</td>
				</tr>
				<tr>
					<td></td>
					<td>
						<span class="Officer Label">Special Offer Disc. %:</span><asp:textbox onkeypress="NumberOnly(1)" id="txtSpecOfferDisc" runat="server" maxlength="8" columns="8"></asp:textbox>
						<asp:rangevalidator id="Rangevalidator8" runat="server" display="Dynamic" errormessage="Special Offer Disc. must >= 0"
							controltovalidate="txtSpecOfferDisc" minimumvalue="0" maximumvalue="9999999" type="Double">!</asp:rangevalidator></td>
				</tr>
				<tr>
					<td class="Supplier Label">IDS Sort</td>
					<td><asp:dropdownlist id="ddlIDSSort" runat="server"></asp:dropdownlist></td>
				</tr>
				<tr>
					<td class="Supplier Label"></td>
					<td><asp:checkbox id="chkTarget" runat="server" text="target"></asp:checkbox>&nbsp;<asp:checkbox id="chkNotAvailInUSA" runat="server" text="not available in USA"></asp:checkbox></td>
				</tr>
				<tr>
					<td class="Supplier Label"></td>
					<td><asp:CheckBox ID="chkArchived" Runat="server" Text="Is Archived"></asp:CheckBox></td>
				</tr>
				<tr>
					<td colspan="2">
						<div class="Legend"><span class="Required">*</span> denotes a required field</div>
					</td>
				</tr>
			</table>
			<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px"
				align="center"><asp:button id="btnSubmit" runat="server" cssclass="Button L2" text="Submit"></asp:button>&nbsp;<asp:button id="btnSave" runat="server" cssclass="Button L2" text="Save"></asp:button>&nbsp;<input class="Button L2" onclick="windowCloseAndRefresh();" type="button" value="Cancel"></div>
			<asp:validationsummary id="ValidationSummary1" runat="server" showsummary="False" showmessagebox="True"></asp:validationsummary>
			<input type="button" runat="server" id="btnFakeSubmit" style="DISPLAY:none" causesvalidation="false">
			<input type="hidden" runat="server" id="hidCurrentOwner"> <input type="hidden" runat="server" id="hidTerritoryID" NAME="hidTerritoryID" value="0">
			<input type="hidden" runat="server" id="hidProductCode" NAME="hidProductCode"> <input type="hidden" id="hidUnitValueArray" runat="server" NAME="hidUnitValueArray">
		</form>
	</body>
</HTML>
